<?php
function selectContent($argument) {
	$contentPath = "scripts/contents/";
	switch ($argument) {
		case "product_list" :
			include ($contentPath . "product_list.php");
			break;
		case "product_details" :
			if (isset($_GET["id"])) {
				include ($contentPath . "product_details.php");
				showDetails($_GET["id"]);
			}
			break;
		case "delete_product" :
			if (isset($_SESSION["moderator"]) && $_SESSION["moderator"] == 1) {
				if (isset($_GET["id"])) {
					include ("scripts/database.php");
					include ("scripts/single_product.php");
					$connection = mysqli_connect(DB_HOST, DB_USERNAME, DB_PASS, DB_NAME);
					deleteSpecifiedProductFromDatabase($connection, $_GET["id"]);
					header("location:index.php?content=product_list");
				}
			}
			break;
		case "edit_product" :
			if (isset($_SESSION["moderator"]) && $_SESSION["moderator"] == 1) {
				include ($contentPath . "product_form.php");
				showForm();
			}
			break;
		case "cart_hiding_place" :
			include ($contentPath . "cart_hiding_place.php");
			break;
		default :
			include ($contentPath . "product_list.php");
			break;
	}
}
?>